package com.example.demo.controller;

import java.util.Date;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PageController {
	@RequestMapping(value="/")
	public String toindex(Map<String,Object> map) {
		map.put("time", new Date());
		map.put("message", "SUCCESS");
		return "index";
	}
	@RequestMapping(value="/topage1")
	public ModelAndView topage1() {
		ModelAndView mav = new ModelAndView();
		mav.setViewName("page1");
		mav.addObject("content", "跳转至page1页面");
		return mav;
	}

}
